function doubleFormat(value) {
  if (typeof(value) !== "number")
    return null;

  var val = value + "";
  var startIndex = 0;
  if ((startIndex = val.indexOf('.')) === -1)
    return val;

  var offset = startIndex + 3;
  return val.length > offset ? val.substring(0, offset) : val;
}
